package us.wili.dev.model.example;

import java.util.ArrayList;
import java.util.List;

public class CompanyExample {
    protected Order order;

    protected boolean distinct;

    protected String lock;

    protected List oredCriteria;

    protected Selector selector;

    protected Limit limit;

    public CompanyExample() {
        oredCriteria = new ArrayList<>();
        distinct = false;
        lock = "";
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public String getLock() {
        return lock;
    }

    public List getOredCriteria() {
        return oredCriteria;
    }

    public Selector getSelector() {
        return selector;
    }

    public Limit getLimit() {
        return limit;
    }

    public Selector select() {
        selector = new Selector();
        return selector;
    }

    public Order orderBy() {
        order = new Order();
        return order;
    }

    public void limit(int rowCount) {
        limit = new Limit(rowCount);
    }

    public void limit(int offset, int rowCount) {
        limit = new Limit(offset, rowCount);
    }

    public void forUpdate() {
        lock = "for update";
    }

    public void lockInShareMode() {
        lock = "lock in share mode";
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = new Criteria();
        oredCriteria.add(new Criteria());
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = new Criteria();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        distinct = false;
    }

    public void clearLock() {
        lock = "";
    }

    public void clearLimit() {
        limit = null;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                return;
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value) {
            if (value == null) {
                return;
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2) {
            if (value1 == null || value2 == null) {
                return;
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andLogoIsNull() {
            addCriterion("`logo` is null");
            return (Criteria) this;
        }

        public Criteria andLogoIsNotNull() {
            addCriterion("`logo` is not null");
            return (Criteria) this;
        }

        public Criteria andLogoEqualTo(String value) {
            addCriterion("`logo` =", value);
            return (Criteria) this;
        }

        public Criteria andLogoNotEqualTo(String value) {
            addCriterion("`logo` <>", value);
            return (Criteria) this;
        }

        public Criteria andLogoGreaterThan(String value) {
            addCriterion("`logo` >", value);
            return (Criteria) this;
        }

        public Criteria andLogoGreaterThanOrEqualTo(String value) {
            addCriterion("`logo` >=", value);
            return (Criteria) this;
        }

        public Criteria andLogoLessThan(String value) {
            addCriterion("`logo` <", value);
            return (Criteria) this;
        }

        public Criteria andLogoLessThanOrEqualTo(String value) {
            addCriterion("`logo` <=", value);
            return (Criteria) this;
        }

        public Criteria andLogoLike(String value) {
            addCriterion("`logo` like", value);
            return (Criteria) this;
        }

        public Criteria andLogoNotLike(String value) {
            addCriterion("`logo` not like", value);
            return (Criteria) this;
        }

        public Criteria andLogoIn(List<String> values) {
            addCriterion("`logo` in ", values);
            return (Criteria) this;
        }

        public Criteria andLogoNotIn(List<String> values) {
            addCriterion("`logo` not  in ", values);
            return (Criteria) this;
        }

        public Criteria andLogoBetween(String value1, String value2) {
            addCriterion("`logo` between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andLogoNotBetween(String value1, String value2) {
            addCriterion("`logo` not between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andNameIsNull() {
            addCriterion("`name` is null");
            return (Criteria) this;
        }

        public Criteria andNameIsNotNull() {
            addCriterion("`name` is not null");
            return (Criteria) this;
        }

        public Criteria andNameEqualTo(String value) {
            addCriterion("`name` =", value);
            return (Criteria) this;
        }

        public Criteria andNameNotEqualTo(String value) {
            addCriterion("`name` <>", value);
            return (Criteria) this;
        }

        public Criteria andNameGreaterThan(String value) {
            addCriterion("`name` >", value);
            return (Criteria) this;
        }

        public Criteria andNameGreaterThanOrEqualTo(String value) {
            addCriterion("`name` >=", value);
            return (Criteria) this;
        }

        public Criteria andNameLessThan(String value) {
            addCriterion("`name` <", value);
            return (Criteria) this;
        }

        public Criteria andNameLessThanOrEqualTo(String value) {
            addCriterion("`name` <=", value);
            return (Criteria) this;
        }

        public Criteria andNameLike(String value) {
            addCriterion("`name` like", value);
            return (Criteria) this;
        }

        public Criteria andNameNotLike(String value) {
            addCriterion("`name` not like", value);
            return (Criteria) this;
        }

        public Criteria andNameIn(List<String> values) {
            addCriterion("`name` in ", values);
            return (Criteria) this;
        }

        public Criteria andNameNotIn(List<String> values) {
            addCriterion("`name` not  in ", values);
            return (Criteria) this;
        }

        public Criteria andNameBetween(String value1, String value2) {
            addCriterion("`name` between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andNameNotBetween(String value1, String value2) {
            addCriterion("`name` not between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andSimpleIsNull() {
            addCriterion("`simple` is null");
            return (Criteria) this;
        }

        public Criteria andSimpleIsNotNull() {
            addCriterion("`simple` is not null");
            return (Criteria) this;
        }

        public Criteria andSimpleEqualTo(String value) {
            addCriterion("`simple` =", value);
            return (Criteria) this;
        }

        public Criteria andSimpleNotEqualTo(String value) {
            addCriterion("`simple` <>", value);
            return (Criteria) this;
        }

        public Criteria andSimpleGreaterThan(String value) {
            addCriterion("`simple` >", value);
            return (Criteria) this;
        }

        public Criteria andSimpleGreaterThanOrEqualTo(String value) {
            addCriterion("`simple` >=", value);
            return (Criteria) this;
        }

        public Criteria andSimpleLessThan(String value) {
            addCriterion("`simple` <", value);
            return (Criteria) this;
        }

        public Criteria andSimpleLessThanOrEqualTo(String value) {
            addCriterion("`simple` <=", value);
            return (Criteria) this;
        }

        public Criteria andSimpleLike(String value) {
            addCriterion("`simple` like", value);
            return (Criteria) this;
        }

        public Criteria andSimpleNotLike(String value) {
            addCriterion("`simple` not like", value);
            return (Criteria) this;
        }

        public Criteria andSimpleIn(List<String> values) {
            addCriterion("`simple` in ", values);
            return (Criteria) this;
        }

        public Criteria andSimpleNotIn(List<String> values) {
            addCriterion("`simple` not  in ", values);
            return (Criteria) this;
        }

        public Criteria andSimpleBetween(String value1, String value2) {
            addCriterion("`simple` between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andSimpleNotBetween(String value1, String value2) {
            addCriterion("`simple` not between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andPhoneIsNull() {
            addCriterion("`phone` is null");
            return (Criteria) this;
        }

        public Criteria andPhoneIsNotNull() {
            addCriterion("`phone` is not null");
            return (Criteria) this;
        }

        public Criteria andPhoneEqualTo(String value) {
            addCriterion("`phone` =", value);
            return (Criteria) this;
        }

        public Criteria andPhoneNotEqualTo(String value) {
            addCriterion("`phone` <>", value);
            return (Criteria) this;
        }

        public Criteria andPhoneGreaterThan(String value) {
            addCriterion("`phone` >", value);
            return (Criteria) this;
        }

        public Criteria andPhoneGreaterThanOrEqualTo(String value) {
            addCriterion("`phone` >=", value);
            return (Criteria) this;
        }

        public Criteria andPhoneLessThan(String value) {
            addCriterion("`phone` <", value);
            return (Criteria) this;
        }

        public Criteria andPhoneLessThanOrEqualTo(String value) {
            addCriterion("`phone` <=", value);
            return (Criteria) this;
        }

        public Criteria andPhoneLike(String value) {
            addCriterion("`phone` like", value);
            return (Criteria) this;
        }

        public Criteria andPhoneNotLike(String value) {
            addCriterion("`phone` not like", value);
            return (Criteria) this;
        }

        public Criteria andPhoneIn(List<String> values) {
            addCriterion("`phone` in ", values);
            return (Criteria) this;
        }

        public Criteria andPhoneNotIn(List<String> values) {
            addCriterion("`phone` not  in ", values);
            return (Criteria) this;
        }

        public Criteria andPhoneBetween(String value1, String value2) {
            addCriterion("`phone` between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andPhoneNotBetween(String value1, String value2) {
            addCriterion("`phone` not between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andWxIsNull() {
            addCriterion("`wx` is null");
            return (Criteria) this;
        }

        public Criteria andWxIsNotNull() {
            addCriterion("`wx` is not null");
            return (Criteria) this;
        }

        public Criteria andWxEqualTo(String value) {
            addCriterion("`wx` =", value);
            return (Criteria) this;
        }

        public Criteria andWxNotEqualTo(String value) {
            addCriterion("`wx` <>", value);
            return (Criteria) this;
        }

        public Criteria andWxGreaterThan(String value) {
            addCriterion("`wx` >", value);
            return (Criteria) this;
        }

        public Criteria andWxGreaterThanOrEqualTo(String value) {
            addCriterion("`wx` >=", value);
            return (Criteria) this;
        }

        public Criteria andWxLessThan(String value) {
            addCriterion("`wx` <", value);
            return (Criteria) this;
        }

        public Criteria andWxLessThanOrEqualTo(String value) {
            addCriterion("`wx` <=", value);
            return (Criteria) this;
        }

        public Criteria andWxLike(String value) {
            addCriterion("`wx` like", value);
            return (Criteria) this;
        }

        public Criteria andWxNotLike(String value) {
            addCriterion("`wx` not like", value);
            return (Criteria) this;
        }

        public Criteria andWxIn(List<String> values) {
            addCriterion("`wx` in ", values);
            return (Criteria) this;
        }

        public Criteria andWxNotIn(List<String> values) {
            addCriterion("`wx` not  in ", values);
            return (Criteria) this;
        }

        public Criteria andWxBetween(String value1, String value2) {
            addCriterion("`wx` between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andWxNotBetween(String value1, String value2) {
            addCriterion("`wx` not between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andAddressIsNull() {
            addCriterion("`address` is null");
            return (Criteria) this;
        }

        public Criteria andAddressIsNotNull() {
            addCriterion("`address` is not null");
            return (Criteria) this;
        }

        public Criteria andAddressEqualTo(String value) {
            addCriterion("`address` =", value);
            return (Criteria) this;
        }

        public Criteria andAddressNotEqualTo(String value) {
            addCriterion("`address` <>", value);
            return (Criteria) this;
        }

        public Criteria andAddressGreaterThan(String value) {
            addCriterion("`address` >", value);
            return (Criteria) this;
        }

        public Criteria andAddressGreaterThanOrEqualTo(String value) {
            addCriterion("`address` >=", value);
            return (Criteria) this;
        }

        public Criteria andAddressLessThan(String value) {
            addCriterion("`address` <", value);
            return (Criteria) this;
        }

        public Criteria andAddressLessThanOrEqualTo(String value) {
            addCriterion("`address` <=", value);
            return (Criteria) this;
        }

        public Criteria andAddressLike(String value) {
            addCriterion("`address` like", value);
            return (Criteria) this;
        }

        public Criteria andAddressNotLike(String value) {
            addCriterion("`address` not like", value);
            return (Criteria) this;
        }

        public Criteria andAddressIn(List<String> values) {
            addCriterion("`address` in ", values);
            return (Criteria) this;
        }

        public Criteria andAddressNotIn(List<String> values) {
            addCriterion("`address` not  in ", values);
            return (Criteria) this;
        }

        public Criteria andAddressBetween(String value1, String value2) {
            addCriterion("`address` between", value1, value2);
            return (Criteria) this;
        }

        public Criteria andAddressNotBetween(String value1, String value2) {
            addCriterion("`address` not between", value1, value2);
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }

    public static class Selector {
        private List<String> columns = new ArrayList<>();

        public int getSize() {
            return columns.size();
        }

        public Selector addWithAlias(String column) {
            columns.add(column+ "AS `" + column + "`");
            return this;
        }

        public List<String> getColumns() {
            return columns;
        }

        public Selector logo() {
            columns.add("company.logo");
            return this;
        }

        public Selector name() {
            columns.add("company.name");
            return this;
        }

        public Selector simple() {
            columns.add("company.simple");
            return this;
        }

        public Selector phone() {
            columns.add("company.phone");
            return this;
        }

        public Selector wx() {
            columns.add("company.wx");
            return this;
        }

        public Selector address() {
            columns.add("company.address");
            return this;
        }

        public Selector introduce() {
            columns.add("company.introduce");
            return this;
        }

        public void clear() {
            columns.clear();
        }
    }

    public static class Order {
        private List<String> columns = new ArrayList<>();

        public int getSize() {
            return columns.size();
        }

        public List<String> getColumns() {
            return columns;
        }

        public Order add(String clause) {
            columns.add(clause);
            return this;
        }

        public Order ascLogo() {
            columns.add("company.logo ASC");
            return this;
        }

        public Order descLogo() {
            columns.add("company.logo DESC");
            return this;
        }

        public Order ascName() {
            columns.add("company.name ASC");
            return this;
        }

        public Order descName() {
            columns.add("company.name DESC");
            return this;
        }

        public Order ascSimple() {
            columns.add("company.simple ASC");
            return this;
        }

        public Order descSimple() {
            columns.add("company.simple DESC");
            return this;
        }

        public Order ascPhone() {
            columns.add("company.phone ASC");
            return this;
        }

        public Order descPhone() {
            columns.add("company.phone DESC");
            return this;
        }

        public Order ascWx() {
            columns.add("company.wx ASC");
            return this;
        }

        public Order descWx() {
            columns.add("company.wx DESC");
            return this;
        }

        public Order ascAddress() {
            columns.add("company.address ASC");
            return this;
        }

        public Order descAddress() {
            columns.add("company.address DESC");
            return this;
        }

        public Order ascIntroduce() {
            columns.add("company.introduce ASC");
            return this;
        }

        public Order descIntroduce() {
            columns.add("company.introduce DESC");
            return this;
        }

        public void clear() {
            columns.clear();
        }
    }

    public static class Limit {
        private int offset;

        private int rowCount;

        private boolean isLmtRow;

        public int getOffset() {
            return offset;
        }

        public int getRowCount() {
            return rowCount;
        }

        public boolean isIsLmtRow() {
            return isLmtRow;
        }

        public Limit(int rowCount) {
            this.rowCount = rowCount; 
            isLmtRow = false;
        }

        public Limit(int offset, int rowCount) {
            this.offset = offset; 
            this.rowCount = rowCount;
            isLmtRow = true;
        }
    }
}